<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="MvcContrib.FluentHtml.ModelViewPage<Universum.Views.MyClasses.MyClassesLabViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Lab
</asp:Content>
<asp:Content ID="BreadcrumbsContent" ContentPlaceHolderID="Breadcrumbs" runat="server">
	<%= Html.Breadcrumb().Home().Append<MyClassesController>(c=>c.Index(),"Your classes").Append<MyClassesController>( c=> c.Class(Model.Class.Slug),  Model.Class.Name).AppendText(Model.Lab.Title).End() %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<div class="span-22">
		<div class="span-22 last">
			<h2>
				<%= Model.Lab.Title %></h2>
			<%=Model.Lab.Text %>
		</div>
		<div class="span-22 last" style="padding: 20px; border-top: 1px dashed #eee">
			<% if (Model.Submission.FileName.IsNotNull())
	  { %>
			<% using (Html.BeginForm<MyClassesController>(c => c.Download(Model.Submission.ID)))
	  { %>
			You have already submitted a file called
			<%=Model.Submission.FileName%>
			that you can
			<%=this.SubmitButton(" download. ") %>
			<%
				}
	  } %>
		</div>
		<%
			if (Model.Lab.SubmissionEnd >= DateTime.Now)
			{
			
		%>
		<div class="span-22 last">
			<fieldset>
				<legend><strong><em>Submit your solution</em></strong></legend>
				<% using (Html.BeginForm<MyClassesController>(c => c.Submit(null, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
	   {
				%>
				<%=this.Hidden(m => m.Submission.ID).Value(Model.Submission.ID)%>
				<%=this.Hidden(m => m.Submission.LabWorkArticleId).Value(Model.Lab.ID)%>
				<label>
					Your work</label>
				<%= this.FileUpload("workFile")%>
				<%=this.SubmitButton("Upload")%>
				<%	 
					}  %>
			</fieldset>
		</div>
		<%}
			else
			{ %>
			<div class="span-22 last">
			<h2><em>Sorry, submissions have ended</em></h2>
			</div>
		<%} %>
	</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptPlaceHolder" runat="server">
</asp:Content>
